package demo4;
import java.util.Scanner;
public class Test01 {
    public static void menu(){
        System.out.println("欢迎使用员工工资计算系统");
        System.out.println("请选择操作类型:");
        System.out.println("1. 计算工资");
        System.out.println("2. 退出系统");
    }

    public static void main(String[] args) {
        boolean flag=true;
        while (flag){
            menu();
            Scanner scanner = new Scanner(System.in);
            int n = scanner.nextInt();
            switch (n) {
                case 1:
                    System.out.print("请输入员工姓名: ");
                    String name = scanner.next();
                    System.out.print("请输入员工工号: ");
                    String id = scanner.next();
                    System.out.print("请输入基本工资: ");
                    double baseSalary = scanner.nextDouble();
                    System.out.print("请输入奖金: ");
                    double bonus = scanner.nextDouble();
                    System.out.print("请输入补贴: ");
                    double allowance = scanner.nextDouble();
                    System.out.print("请输入工作月份数: ");
                    int months = scanner.nextInt();
                    double totalSalary = (baseSalary + bonus + allowance) * months;
                    System.out.printf("员工姓名: %s\n", name);
                    System.out.printf("员工工号: %s\n", id);
                    System.out.printf("总工资: %.2f 元\n", totalSalary);
                    break;
                case 2:
                    System.out.println("感谢使用");
                    flag=false;
                    break;
            }
        }
    }
}
